<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var obj = {
        name: '张三',
        age: 20,
      }
      //对象没有length属性
      //    console.log(obj.length)
      //对象的循环
      for (var key in obj) {
        console.log(obj[key])
        //由于这里的key是变量 不能采用打点的形式访问键值  应使用中括号[variable]
        // console.log(obj.key);
      }
    </script>
  </body>
</html>
